package com.euond.permission.mapper;

import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.euond.common.core.dao.BaseEuondMapper;
import com.euond.permission.entities.Resource;
import com.euond.permission.entities.RoleResource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by Daniel on 18/06/2017.
 * RoleResource Dao
 */
@Mapper
public interface RoleResourceMapper extends BaseEuondMapper<RoleResource> {

    /**
     * 查询角色资源关系（分页）
     * @param
     * @return
     */
    List<RoleResource> findRoleResources(Pagination page, RoleResource roleResource);

    /**
     * 按角色查找已分配角色的资源(分页)
     * @param roleId
     * @return
     */
    public List<RoleResource> findRoleAvailableResources(Pagination page, @Param("roleId") Long roleId,@Param("resourceName") String resourceName);

    /**
     * 按角色查找未分配角色的资源(分页)
     * @param roleId
     * @param resourceName
     * @return
     */
    public List<Resource> findRoleNotAvailableResources(Pagination page, @Param("roleId") Long roleId, @Param("resourceName") String resourceName);
}
